﻿<include file="Public/head"/>
    <div class="container-fluid">
        <div class="row-fluid">
            <h4>商品管理</h4>
            <div class="add"><a class="btn btn-success" href="{:U('Test/add')}">新增</a></div>
            <div class="w">
                <div class="span12">
                    <table class="table table-condensed table-bordered table-hover tab">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>数量</th>
                                <th>重量</th>
                                <th>图片</th>
                                <th>链接</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody id="tbody">
                            <?php foreach($data as $v){?>
                                <tr>
                                    <td><?=$v['id']?></td>
                                    <td><?=$v['name']?></td>
                                    <td><?=$v['num']?></td>
                                    <td><?=$v['weight']?></td>
                                    <td>
                                        <?php if($v['img']){?>
                                            <img src="__PUBLIC__/uploads/<?=$v['img']?>" />
                                        <?php }else{?>
                                            暂无图片
                                        <?php }?>
                                    </td>
                                    <td>
                                        <?php if($v['link']){?>
                                            <a href="<?=$v['link']?>">链接</a>
                                        <?php }else{?>
                                            暂无链接
                                        <?php }?>

                                    </td>
                                    <td><a href="{:U('Test/edit')}?id=<?=$v['id']?>">修改</a>　<a href='{:U("Test/del")}' data-id="<?=$v['id']?>" onclick="return del(this)">删除</a></td>
                                </tr>
                            <?php }?>
                        </tbody>
                    </table>
                    <div id="page" class="tr"></div>
                </div>
            </div>
        </div>
    </div>

<include file="Public/foot"/>
